
import { HashRouter, Routes, Route, Navigate } from "react-router-dom";
import { ConfigProvider, theme } from 'antd';
import Lazy from 'components/Lazy';

const { darkAlgorithm, compactAlgorithm } = theme;

export default function App() {
    return (
            <ConfigProvider theme={themeConfig} >
                <HashRouter>
                    <Routes>
                        <Route path='workbench/*' element={<Lazy factory={() => import('pages/Workbench')} />} />
                        <Route path='preview' element={<Lazy factory={() => import('pages/Preview')} />} />
                        <Route path='*' element={<Navigate to="workbench" />} />
                    </Routes>
                </HashRouter>
            </ConfigProvider>
    )
}

const themeConfig = {
    algorithm: [darkAlgorithm, compactAlgorithm],
    token: { colorPrimary: 'violet' },
}